<?php
error_reporting(-1);
session_start();
require_once './classes/Auth.class.php';
require_once './includes/loadservers.php'; 
require_once './includes/parselang.php'; 

while($row = mysqli_fetch_array($result)) 
{ 

$params = '-webMode MP -Origin_NoAppFocus -onlineEnvironment prod -loginToken 0-0-0-0-0-0 -AuthToken 0-0-0-0-0-0 -requestState State_ClaimReservation -requestStateParams "<data putinsquad=\"true\" gameid=\"'.$row['gid'].'\" personaref=\"'.$pid.'\" levelmode=\"mp\"></data>"|'.$hostIP.'|';
$joinServerLink = "bf3Lan://".base64_encode ( $params );


$mapName = $lang[$row['level']];

if( $row['description1'] == "" )
{
	$descr = $lang['No description'];
}
else
{
	$descr = $row['description1'];
}

echo "<tr class='server'>
	<td class='mapPlayUnderlay'><a onclick='javascript:startBF3(\"$joinServerLink\");'><div class='mapThumb' style='background-image: url(./mapThumbs/$row[level].jpg);'></div></a></td>
	<td class='serverInfo'>
	<p style='margin-bottom:20px' class='serverName'>$row[gnam]</p>
	<p class='serverDiscr1'>$descr</p>
	<p class='serverMode'>
	";
	
	$expansionPacks = explode(";",$row['modd']);
	
	foreach ($expansionPacks as $expansionPack)
	{
		echo "<img class='expansionPack' src='img/expansionPacks/$expansionPack.gif'>";
	}
	$mode = $lang[$row['mode']];
	echo "&nbsp; $mode &middot; $mapName</p>
	</td>
	<td class='playerCount'>$row[online] / $row[pcap]</td>
	<td class='hardcore'><img src='img/$row[preset].png'></td>
	<td class='hardcore1'><div class='ping-bar good'></div></td>
	</tr>";
}
mysqli_close($link);
?>